package com.lt;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author lucine
 * @version 1.0 2021/5/22 22:33
 */
public class Slf4jTest {

    public static  final Logger LOGGER = LoggerFactory.getLogger(Slf4jTest.class);

    @Test
    public void testQuick(){
        //日志输出
        LOGGER.error("error");
        LOGGER.warn("warn");
        LOGGER.info("info");
        LOGGER.debug("debug");
        LOGGER.trace("trace");

        //使用占位符
        String name = "lt";
        int age = 12;
        LOGGER.info("用户{},age{}",name,age);


        //将系统异常信息输出
        try{
            int i  = 1/0;
        }catch(Exception e){
//            e.printStackTrace();
            LOGGER.error("出现异常",e);
        }

    }
}
